package com.ruoyi.order.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.order.mapper.PaymentMapper;
import com.ruoyi.order.domain.Payment;
import com.ruoyi.order.service.IPaymentService;

/**
 * 付款管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-06-06
 */
@Service
public class PaymentServiceImpl implements IPaymentService 
{
    @Autowired
    private PaymentMapper paymentMapper;

    /**
     * 查询付款管理
     * 
     * @param paymentId 付款管理ID
     * @return 付款管理
     */
    @Override
    public Payment selectPaymentById(Long paymentId)
    {
        return paymentMapper.selectPaymentById(paymentId);
    }

    /**
     * 查询付款管理列表
     * 
     * @param payment 付款管理
     * @return 付款管理
     */
    @Override
    public List<Payment> selectPaymentList(Payment payment)
    {
        return paymentMapper.selectPaymentList(payment);
    }

    /**
     * 新增付款管理
     * 
     * @param payment 付款管理
     * @return 结果
     */
    @Override
    public int insertPayment(Payment payment)
    {
        payment.setCreateTime(DateUtils.getNowDate());
        return paymentMapper.insertPayment(payment);
    }

    /**
     * 修改付款管理
     * 
     * @param payment 付款管理
     * @return 结果
     */
    @Override
    public int updatePayment(Payment payment)
    {
        return paymentMapper.updatePayment(payment);
    }

    /**
     * 批量删除付款管理
     * 
     * @param paymentIds 需要删除的付款管理ID
     * @return 结果
     */
    @Override
    public int deletePaymentByIds(Long[] paymentIds)
    {
        return paymentMapper.deletePaymentByIds(paymentIds);
    }

    /**
     * 删除付款管理信息
     * 
     * @param paymentId 付款管理ID
     * @return 结果
     */
    @Override
    public int deletePaymentById(Long paymentId)
    {
        return paymentMapper.deletePaymentById(paymentId);
    }
}
